import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import {RenderType} from '@pkg/setting';
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'userName',
    width: 150,
  },
  {
    title: '身份证号',
    dataIndex: 'identityNo',
    width: 120,
  },
  {
    title: '审核状态',
    dataIndex: 'isPrivatedata',
    width: 120,
    dictData: [
      { label: '未认证', value: 1, color: '#a6a9a6' },
      { label: '已认证', value: 2, color: '#09d550' }
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '姓名',
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'htmlTitle',
    component: 'Input',
    required: true,
  },
  {
    label: '编码',
    field: 'htmlCode',
    component: 'Input',
    required: true,
    dynamicDisabled: ({ values }) => {
      return !!values.htmlId;
    },
  },
  {
    label: '排序',
    field: 'sortOrder',
    component: 'InputNumber',
    required: true,
  },
  {
    label: '内容',
    field: 'htmlContent',
    component: 'TyEditor',
    required: true,
  },
];
